/***********************************************************************************************************************************
 *    Name: Backup_Exclusions.sql
 *  Author: Frank Figearo — http://www.sqlnerd.me/ — frank@sqlnerd.me
 * Summary: 
**/
USE DBAdmin;
SELECT sc.Category, sc.HostName,
	SQLDataRoot	= CASE WHEN CHARINDEX(sc.SQLDataRoot,sc.DefaultData) <> 0 OR CHARINDEX(sc.SQLDataRoot,sc.DefaultLog) <> 0 THEN sc.SQLDataRoot ELSE 'n/a' END,
	DefaultData	= CASE CHARINDEX(sc.SQLDataRoot,sc.DefaultData) WHEN 0 THEN sc.DefaultData ELSE 'n/a' END,
	DefaultLog	= CASE CHARINDEX(sc.SQLDataRoot,sc.DefaultLog) WHEN 0 THEN sc.DefaultLog ELSE 'n/a' END
  FROM dbo.ShowConfiguration sc
  ORDER BY sc.Category, sc.HostName;